package cn.tedu.mapper.petcommodity;

import cn.tedu.pojo.pet.entity.PetCategory;
import cn.tedu.pojo.pet.entity.PetCommodity;
import cn.tedu.pojo.pet.entity.PetDetails;
import cn.tedu.pojo.pet.vo.PetCommodityVO;
import cn.tedu.pojo.pet.vo.PetDetailsVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface PetCommodityMapper {
    //管理员添加宠物商品列表
    int addCommodity(PetCommodity petCommodity);
    //管理员修改宠物商品列表
    void updateCommodity(@Param("oldName")String oldName,@Param("newName")String newName);
    //管理员修改宠物商品启用状态//TODO
    void updateIsDelete(@Param("commodityName")String commodityName,@Param("isDelete")Integer isDelete);
    //通过宠物品种名称获取品种id
    PetCategory getIdByCategoryName(String categoryName);
    //通过id查询对应商品列表//
    List<PetCommodityVO> selectCommodity(Long id);

    //在商品中查询是否存在指定商品名字的数据//
    PetCommodity getDetailsByCommodityName(String commodityName);

    //通过商品id查找详情表中能否返回数据
    PetDetails getDetailsByCommodityId(Long id);

    //通过商品id查询对应详情列表//
    PetDetailsVO listDetailsById(Long id);

    PetCommodity getByCommodityName(String  commodityName);
}
